home *** CD-ROM | disk | FTP | other *** search
/ MacAddict 104 / MacAddict_104_2005-04.iso / Software / Internet & Communication / WordPress 1.2.2 freeware.dmg / wordpress / wp-admin / options-writing.php < prev    next >
Encoding:
PHP Script  |  2004-05-08  |  5.7 KB  |  127 lines

  1. <?php
  2. require_once('../wp-includes/wp-l10n.php');
  3.  
  4. $title = __('Writing Options');
  5. $parent_file = 'options-general.php';
  6.  
  7. function add_magic_quotes($array) {
  8.     foreach ($array as $k => $v) {
  9.         if (is_array($v)) {
  10.             $array[$k] = add_magic_quotes($v);
  11.         } else {
  12.             $array[$k] = addslashes($v);
  13.         }
  14.     }
  15.     return $array;
  16. }
  17.  
  18. if (!get_magic_quotes_gpc()) {
  19.     $_GET    = add_magic_quotes($_GET);
  20.     $_POST   = add_magic_quotes($_POST);
  21.     $_COOKIE = add_magic_quotes($_COOKIE);
  22. }
  23.  
  24. $wpvarstoreset = array('action','standalone', 'option_group_id');
  25. for ($i=0; $i<count($wpvarstoreset); $i += 1) {
  26.     $wpvar = $wpvarstoreset[$i];
  27.     if (!isset($$wpvar)) {
  28.         if (empty($_POST["$wpvar"])) {
  29.             if (empty($_GET["$wpvar"])) {
  30.                 $$wpvar = '';
  31.             } else {
  32.                 $$wpvar = $_GET["$wpvar"];
  33.             }
  34.         } else {
  35.             $$wpvar = $_POST["$wpvar"];
  36.         }
  37.     }
  38. }
  39.  
  40.  
  41.  
  42. $standalone = 0;
  43. include_once('admin-header.php');
  44. include('options-head.php');
  45. ?>
  46.  
  47. <div class="wrap"> 
  48.   <h2>Writing Options</h2> 
  49.   <form name="form1" method="post" action="options.php"> 
  50.     <input type="hidden" name="action" value="update" /> 
  51.     <input type="hidden" name="page_options" value="'default_post_edit_rows','use_smilies','use_balanceTags','advanced_edit','ping_sites','mailserver_url', 'mailserver_port','mailserver_login','mailserver_pass','default_category'" /> 
  52.     <table width="100%" cellspacing="2" cellpadding="5" class="editform"> 
  53.       <tr valign="top">
  54.         <th scope="row"> <?php _e('When starting a post, show:') ?> </th>
  55.         <td><?php get_settings('advanced_edit') ?><label>
  56.           <input name="advanced_edit" type="radio" value="0" <?php checked('0', get_settings('advanced_edit')); ?> />
  57. <?php _e('Simple controls') ?></label>
  58.           <br />
  59.           <label>
  60.           <input name="advanced_edit" type="radio" value="1" <?php checked('1', get_settings('advanced_edit')); ?> />
  61. <?php _e('Advanced controls') ?></label>
  62.           <label for="advanced_edit"></label></td>
  63.       </tr>
  64.       <tr valign="top"> 
  65.         <th width="33%" scope="row"> Size of the writing box:</th> 
  66.         <td><input name="default_post_edit_rows" type="text" id="default_post_edit_rows" value="<?php echo get_settings('default_post_edit_rows'); ?>" size="2" style="width: 1.5em; " /> 
  67.           lines </td> 
  68.       </tr> 
  69.       <tr valign="top">
  70.         <th scope="row"><?php _e('Formatting:') ?></th>
  71.         <td>          <label for="label">
  72.           <input name="use_smilies" type="checkbox" id="label" value="1" <?php checked('1', get_settings('use_smilies')); ?> />
  73.           <?php _e('Convert emoticons like <code>:-)</code> and <code>:-P</code> to graphics on display') ?></label> <br />          <label for="label2">
  74.   <input name="use_balanceTags" type="checkbox" id="label2" value="1" <?php checked('1', get_settings('use_balanceTags')); ?> />
  75.           <?php _e('WordPress should correct invalidly nested XHTML automatically') ?></label></td>
  76.       </tr>
  77.     </table> 
  78.     <fieldset class="options">
  79.     <legend><?php _e('Update Services') ?></legend>
  80.           <p><?php printf(__('Enter the sites that you would like to notify when you publish a new post. For a list of some recommended sites to ping please see <a href="%s">Update Services</a> on the wiki. Separate multiple URIs by line breaks.'), 'http://wiki.wordpress.org/index.php/UpdateServices') ?></p>
  81.     
  82.     <textarea name="ping_sites" id="ping_sites" style="width: 98%;"><?php echo get_settings('ping_sites'); ?></textarea>
  83.     </fieldset>
  84.     <fieldset class="options">
  85.     <legend><?php _e('Writing by Email') ?></legend>
  86.     <p><?php printf(__('To post to WordPress by email you must set up a secret email account with POP3 access. Any mail received at this address will be posted, so it’s a good idea to keep this address very secret. Here are three random strings you could use: <code>%s</code>, <code>%s</code>, <code>%s</code>.'), substr(md5(uniqid(microtime())),0,5), substr(md5(uniqid(microtime())),0,5), substr(md5(uniqid(microtime())),0,5)) ?></p>
  87.     
  88.         <table width="100%" cellspacing="2" cellpadding="5" class="editform">
  89.             <tr valign="top">
  90.                 <th scope="row"><?php _e('Mail server:') ?></th>
  91.                 <td><input name="mailserver_url" type="text" id="mailserver_url" value="<?php echo get_settings('mailserver_url'); ?>" size="40" />
  92.                 <label for="port"><?php _e('Port:') ?></label> 
  93.                 <input name="mailserver_port" type="text" id="mailserver_port" value="<?php echo get_settings('mailserver_port'); ?>" size="6" />
  94.                    </td>
  95.                </tr>
  96.             <tr valign="top">
  97.                 <th width="33%" scope="row"><?php _e('Login name:') ?></th>
  98.                 <td><input name="mailserver_login" type="text" id="mailserver_login" value="<?php echo get_settings('mailserver_login'); ?>" size="40" /></td>
  99.                </tr>
  100.             <tr valign="top">
  101.                 <th scope="row"><?php _e('Password:') ?></th>
  102.                 <td>
  103.                     <input name="mailserver_pass" type="text" id="mailserver_pass" value="<?php echo get_settings('mailserver_pass'); ?>" size="40" />
  104.                 </td>
  105.                </tr>
  106.             <tr valign="top">
  107.                 <th scope="row"><?php _e('Usual category:') ?></th>
  108.                 <td><select name="default_category" id="default_category">
  109. <?php
  110. $categories = $wpdb->get_results("SELECT * FROM $tablecategories ORDER BY cat_name");
  111. foreach ($categories as $category) :
  112. if ($category->cat_ID == get_settings('default_category')) $selected = " selected='selected'";
  113. else $selected = '';
  114.     echo "\n\t<option value='$category->cat_ID' $selected>$category->cat_name</option>";
  115. endforeach;
  116. ?>
  117.                    </select></td>
  118.                </tr>
  119.             </table>
  120.         </fieldset>
  121.     <p class="submit"> 
  122.       <input type="submit" name="Submit" value="<?php _e('Update Options') ?> »" /> 
  123.     </p> 
  124.   </form> 
  125. </div> 
  126. <?php include("admin-footer.php") ?>
  127.